<template>
  <div class="app-container detail-container yuanggong-page">
    <el-card shadow="never" style="margin-top: 15px;">
      <div slot="header" class="clearfix" style="position: relative">
          <div class="user-info" style="padding-left:80px">
             <div class="user-img" style="position: absolute;left:0;text-align: center">
                 <img :src="overviewInfo.detail.logo" style="width:60px;border-radius: 50%;height:60px;object-fit:cover" v-if="overviewInfo.detail && overviewInfo.detail.logo != ''"/>
                 <img src="https://pic.moresu.com/Fu15C35Itv16trEDEhyJBtBJBm3M" style="width:60px;border-radius: 50%;height:60px;object-fit:cover" v-else/>
               <el-upload
                   :show-file-list="false"
                   :data="uploadToken"
                   action="https://upload.qiniup.com"
                   :on-success="handleAvatarSuccess3">
                   <el-button type="text" size="mini">修改头像</el-button>
                 </el-upload>
             </div>
             <div class="user-left" style="min-height: 80px;padding-top:10px">
                 <div class="user-name">
                   <span style="vertical-align: middle">{{ form.userName }}</span>
                   <span class="user-label">{{ form.departmentName }}</span>
                   <span class="user-label">{{ form.job }}</span>
<!--                   <span class="user-label">天狼队</span>-->
<!--                   <span class="user-label">军团长</span>-->
                 </div>
                 <div style="padding-top:10px;font-size:14px;color:#97a8be">
                   <span> {{form.gender == 1 | fifgender}} </span>
                   <span style="padding-left:20px">{{ form.joinTime }} 入职</span>
                   <span style="padding-left:20px">司龄 {{ form.years | fifYears}}</span>
                 </div>
             </div>
          </div>
      </div>

      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="概览" name="first">
            <div class="info-title">个人概况</div>
            <table style="width:100%;border-top:1px solid #EBEEF5;border-left:1px solid #EBEEF5;" cellpadding="0" cellspacing="0">
                <tr>
                    <th style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;background:#f5f7fa;padding:15px 0 ;color:#909399;font-size:14px;">部门名称</th>
                    <th style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;background:#f5f7fa;padding:15px 0 ;color:#909399;font-size:14px;">部门主管</th>
                    <th style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;background:#f5f7fa;padding:15px 0 ;color:#909399;font-size:14px;">军团</th>
                    <th style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;background:#f5f7fa;padding:15px 0 ;color:#909399;font-size:14px;">军团主管</th>
                    <th style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;background:#f5f7fa;padding:15px 0 ;color:#909399;font-size:14px;">军团政委</th>
                    <th style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;background:#f5f7fa;padding:15px 0 ;color:#909399;font-size:14px;">部门职位</th>
                    <th style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;background:#f5f7fa;padding:15px 0 ;color:#909399;font-size:14px;">军团职位</th>
                </tr>
                <tr>
                  <td align="center" style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;padding:15px 0 ;color:#909399;font-size:14px;">
                    {{ form.departmentName }}</td>
                  <td align="center" style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;padding:15px 0 ;color:#909399;font-size:14px;"></td>
                  <td align="center" style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;padding:15px 0 ;color:#909399;font-size:14px;"></td>
                  <td align="center" style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;padding:15px 0 ;color:#909399;font-size:14px;"></td>
                  <td align="center" style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;padding:15px 0 ;color:#909399;font-size:14px;">
                    </td>
                  <td align="center" style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;padding:15px 0 ;color:#909399;font-size:14px;">
                    {{ form.job }}</td>
                  <td align="center" style="border-right:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5;padding:15px 0 ;color:#909399;font-size:14px;">
                  </td>
                </tr>
            </table>

            <div class="info-title">成长记录</div>
            <div class="fenxi-row">
              <div class="fenxi-col">
                <div class="num">{{ overviewInfo.rewardCount}}</div>
                <div class="name">奖励次数</div>
              </div>
              <div class="fenxi-col">
                <div class="num">{{ overviewInfo.punishmentCount}}</div>
                <div class="name">处罚次数</div>
              </div>
              <div class="fenxi-col">
                <div class="num">{{ overviewInfo.trainCount}}</div>
                <div class="name">增训次数</div>
              </div>
              <div class="fenxi-col">
                <div class="num">{{ overviewInfo.communicateCount}}</div>
                <div class="name">沟通次数</div>
              </div>
            </div>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable">
              <tr>
                <td class="bgtd" style="width:200px"><div class="tddiv">雄心壮志</div></td>
                <td class="contd">{{form.ambition}}</td>
                <td class="bgtd" style="width:200px"><div class="tddiv">工作信条</div></td>
                <td class="contd">{{form.creed}}</td>
              </tr>
              <tr>
                <td class="bgtd" style="width:200px"><div class="tddiv">英雄宣言</div></td>
                <td class="contd">{{form.declaration}}</td>
                <td class="bgtd" style="width:200px"><div class="tddiv">最喜欢被提醒需转变的方式</div></td>
                <td class="contd">{{form.remind}}</td>
              </tr>
            </table>

          <el-timeline style="margin-top:40px">
            <el-timeline-item
              v-for="(activity, index) in growUpUserList"
              :key="index"
              :timestamp="activity.time">
              {{activity.content}}
            </el-timeline-item>
          </el-timeline>
        </el-tab-pane>
        <el-tab-pane label="在职信息" name="second">
          <div class="info-title">在职信息 <el-button type="text" style="float:right;" @click="showPop11">编辑</el-button></div>
          <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable">
            <tr>
              <td class="bgtd"><div class="tddiv">工号</div></td>
              <td class="contd">{{form.jobNumber}}</td>
              <td class="bgtd"><div class="tddiv">合同公司</div></td>
              <td class="contd">{{form.contractCompany}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">部门</div></td>
              <td class="contd">{{form.departmentName}}</td>
              <td class="bgtd"><div class="tddiv">岗位</div></td>
              <td class="contd">{{form.job}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">员工性质</div></td>
              <td class="contd">{{form.attribute | fifattribute}}</td>
              <td class="bgtd"><div class="tddiv">员工状态</div></td>
              <td class="contd">{{form.status | fifygstatus}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">入职时间</div></td>
              <td class="contd">{{form.joinTime}}</td>
              <td class="bgtd"><div class="tddiv">试用期</div></td>
              <td class="contd">{{form.probation}} 个月</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">转正时间</div></td>
              <td class="contd">{{form.workTime}}</td>
              <td class="bgtd"><div class="tddiv">司龄</div></td>
              <td class="contd">{{form.years | fifYears}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">优点</div></td>
              <td class="contd">{{form.advantage}}</td>
              <td class="bgtd"><div class="tddiv">需提升点</div></td>
              <td class="contd">{{form.improved}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">雄心壮志</div></td>
              <td class="contd">{{form.ambition}}</td>
              <td class="bgtd"><div class="tddiv">工作信条</div></td>
              <td class="contd">{{form.creed}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">英雄宣言</div></td>
              <td class="contd">{{form.declaration}}</td>
              <td class="bgtd"><div class="tddiv">最喜欢被提醒需转变的方式</div></td>
              <td class="contd">{{form.remind}}</td>
            </tr>
          </table>
          <div class="info-title">任职记录 <el-button type="text" style="float:right;" @click="showPop1('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in showOfficeList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop1('edit',item)"></el-button>
              <el-button type="primary" icon="el-icon-delete" size="mini" @click="delRZ(item)"></el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable" >
              <tr >
                <td class="bgtd"><div class="tddiv">任职开始日期</div></td>
                <td class="contd">{{item.startTime}}</td>
                <td class="bgtd"><div class="tddiv">任职结束日期</div></td>
                <td class="contd">{{item.endTime}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">部门</div></td>
                <td class="contd">{{item.department}}</td>
                <td class="bgtd"><div class="tddiv">岗位</div></td>
                <td class="contd">{{item.job}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">合同公司</div></td>
                <td class="contd" colspan="3">{{item.contractCompany}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">任职备注</div></td>
                <td class="contd" colspan="3">{{item.remark}}</td>
              </tr>
            </table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="基本信息" name="third">
          <div class="info-title">基本信息 <el-button type="text" style="float:right;" @click="showPop12">编辑</el-button></div>
          <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable">
            <tr>
              <td class="bgtd"><div class="tddiv">姓名</div></td>
              <td class="contd">{{form.userName}}</td>
              <td class="bgtd"><div class="tddiv">性别</div></td>
              <td class="contd">{{form.gender | fifgender}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">证件类型</div></td>
              <td class="contd">{{form.certificatesType == 1 ? '身份证' : ''}}</td>
              <td class="bgtd"><div class="tddiv">证件号码</div></td>
              <td class="contd">{{form.certificates}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">员工性质</div></td>
              <td class="contd">{{form.attribute | fifattribute}}</td>
              <td class="bgtd"><div class="tddiv">员工状态</div></td>
              <td class="contd">{{form.status | fifygstatus}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">生日</div></td>
              <td class="contd">{{form.brithTime}}</td>
              <td class="bgtd"><div class="tddiv">出生日期</div></td>
              <td class="contd">{{form.probation}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">年龄</div></td>
              <td class="contd">{{form.workTime}}</td>
              <td class="bgtd"><div class="tddiv">民族</div></td>
              <td class="contd">{{form.nation}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">籍贯</div></td>
              <td class="contd">{{form.nativePlace}}</td>
              <td class="bgtd"><div class="tddiv">政治面貌</div></td>
              <td class="contd">{{form.politicalStatus}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">参加工作时间</div></td>
              <td class="contd">{{form.firstWorkTime}}</td>
              <td class="bgtd"><div class="tddiv"></div></td>
              <td class="contd"></td>
            </tr>
          </table>
          <div class="info-title">教育经历 <el-button type="text" style="float:right;" @click="showPop7('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in schoolList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop7('edit',item)"></el-button>
              <el-button type="primary" icon="el-icon-delete" size="mini" @click="delJY(item)"></el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable" >
              <tr >
                <td class="bgtd"><div class="tddiv">开始日期</div></td>
                <td class="contd">{{item.startTime}}</td>
                <td class="bgtd"><div class="tddiv">结束日期</div></td>
                <td class="contd">{{item.endTime}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">学校名称</div></td>
                <td class="contd">{{item.schoolName}}</td>
                <td class="bgtd"><div class="tddiv">学历</div></td>
                <td class="contd">{{item.schoolType | fifmajor}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">专业</div></td>
                <td class="contd" colspan="3">{{item.major }}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">备注</div></td>
                <td class="contd" colspan="3">{{item.remark}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">附件</div></td>
                <td class="contd" colspan="3">
                  <img :src="item.url"  v-if="item.url!= ''" @click="fullImg(item.url)" style="cursor: pointer;width:50px;object-fit: contain"/>
                </td>
              </tr>
            </table>
          </div>
          <div class="info-title">工作经历 <el-button type="text" style="float:right;" @click="showPop5('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in workingList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop5('edit',item)"></el-button>
              <el-button type="primary" icon="el-icon-delete" size="mini" @click="delGZ(item)"></el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable" >
              <tr >
                <td class="bgtd"><div class="tddiv">工作单位</div></td>
                <td class="contd">{{item.workingName}}</td>
                <td class="bgtd"><div class="tddiv">职务</div></td>
                <td class="contd">{{item.job}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">开始时间</div></td>
                <td class="contd">{{item.startTime}}</td>
                <td class="bgtd"><div class="tddiv">结束时间</div></td>
                <td class="contd">{{item.endTime}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">证明人</div></td>
                <td class="contd">{{item.witness}}</td>
                <td class="bgtd"><div class="tddiv">证明电话</div></td>
                <td class="contd">{{item.witnessPhone}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">离职原因</div></td>
                <td class="contd" colspan="3">{{item.reasonsLeaving}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">工作备注</div></td>
                <td class="contd" colspan="3">{{item.remark}}</td>
              </tr>
            </table>
          </div>
          <div class="info-title">证书 <el-button type="text" style="float:right;" @click="showPop6('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in majorListUserList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop6('edit',item)"></el-button>
                  <el-button type="primary" icon="el-icon-delete" size="mini" @click="delZS(item)"></el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable" >
              <tr >
                <td class="bgtd"><div class="tddiv">证书名称</div></td>
                <td class="contd">{{item.majorName}}</td>
                <td class="bgtd"><div class="tddiv">发证日期</div></td>
                <td class="contd">{{item.startTime}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">有效期</div></td>
                <td class="contd">{{item.endTime}}</td>
                <td class="bgtd"><div class="tddiv">证书编号</div></td>
                <td class="contd">{{item.number}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">证书备注</div></td>
                <td class="contd" colspan="3">{{item.remark}}</td>
              </tr>
            </table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="联系信息" name="fourth">
          <div class="info-title">联系信息 <el-button type="text" style="float:right;" @click="showPop13">编辑</el-button></div>
          <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable">
            <tr>
              <td class="bgtd"><div class="tddiv">手机号</div></td>
              <td class="contd">{{form.mobile}}</td>
              <td class="bgtd"><div class="tddiv">QQ号</div></td>
              <td class="contd">{{form.qq }}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">微信号</div></td>
              <td class="contd">{{form.wechat}}</td>
              <td class="bgtd"><div class="tddiv">个人邮箱</div></td>
              <td class="contd">{{form.email}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">工作电话</div></td>
              <td class="contd">{{form.workingMobile}}</td>
              <td class="bgtd"><div class="tddiv">工作邮箱</div></td>
              <td class="contd">{{form.workingEmail}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">现居住地</div></td>
              <td class="contd" colspan="3">{{form.address}}</td>
            </tr>
          </table>
          <div class="info-title">紧急联系人 <el-button type="text" style="float:right;" @click="showPop8('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in contactList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop8('edit',item)"></el-button>
              <el-button type="primary" icon="el-icon-delete" size="mini" @click="delLXR(item)"></el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable" >
              <tr >
                <td class="bgtd"><div class="tddiv">联系人姓名</div></td>
                <td class="contd">{{item.name}}</td>
                <td class="bgtd"><div class="tddiv">关系</div></td>
                <td class="contd">{{item.relation}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">手机号</div></td>
                <td class="contd">{{item.phone}}</td>
                <td class="bgtd"><div class="tddiv">联系人地址</div></td>
                <td class="contd">{{item.address}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">是否为主联系人</div></td>
                <td class="contd" colspan="3">{{item.isMain == 1 ? '是' : '否' }}</td>
              </tr>

            </table>
          </div>
          <div class="info-title">家庭成员 <el-button type="text" style="float:right;" @click="showPop9('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in homeList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop9('edit',item)"></el-button>
              <el-button type="primary" icon="el-icon-delete" size="mini" @click="delCY(item)"></el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable" >
              <tr >
                <td class="bgtd"><div class="tddiv">成员姓名</div></td>
                <td class="contd">{{item.name}}</td>
                <td class="bgtd"><div class="tddiv">关系</div></td>
                <td class="contd">{{item.relation}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">工作单位</div></td>
                <td class="contd">{{item.company}}</td>
                <td class="bgtd"><div class="tddiv">任职岗位</div></td>
                <td class="contd">{{item.job}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">联系方式</div></td>
                <td class="contd" colspan="3">{{item.phone}}</td>
              </tr>

            </table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="业绩信息" name="five">
          <el-table :data="achievementList" border>
            <el-table-column label="月份" prop="time"  align="center"></el-table-column>
            <el-table-column label="总销量(目标/实际/完成率)"  align="center">
              <template slot-scope="scope">
                  {{scope.row.targetSales}} / {{scope.row.actualSales}} / {{scope.row.actualSales | fifBFB(scope.row.targetSales)}}%
              </template>
            </el-table-column>
            <el-table-column label="新客户数(目标/实际/完成率)"  align="center">
              <template slot-scope="scope">
                {{scope.row.targetCustomersNum}} / {{scope.row.actualCustomersNum}} / {{scope.row.actualCustomersNum | fifBFB(scope.row.targetCustomersNum)}}%
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="奖罚" name="six">
          <div class="info-title">奖惩记录 <el-button type="text" style="float:right;" @click="showPop3('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in showRewardUserList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop3('edit',item)"></el-button>
              <el-button type="primary" size="mini" @click="CXJC(item)" v-if="item.revokeStatus != 2">撤消</el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable">
              <tr>
                <td class="bgtd"><div class="tddiv">奖励/惩罚</div></td>
                <td class="contd">{{item.status == 1 ? '奖励' : '惩罚'}}</td>
                <td class="bgtd"><div class="tddiv">奖惩日期</div></td>
                <td class="contd">{{item.rewardTime}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">奖惩内容</div></td>
                <td class="contd" colspan="3">{{item.content}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">奖惩金额</div></td>
                <td class="contd">{{item.money}}</td>
                <td class="bgtd"><div class="tddiv">奖惩原因</div></td>
                <td class="contd">{{item.reason}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">是否撤消</div></td>
                <td class="contd">{{item.revokeStatus == 2 ? '是' : '否'}}</td>
                <td class="bgtd"><div class="tddiv">撤消原因</div></td>
                <td class="contd">{{item.revokeRemark}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">奖惩备注</div></td>
                <td class="contd" colspan="3">{{item.remark}}</td>
              </tr>
            </table>
          </div>
          <div v-if="showRewardUserList.length == 0 " style="padding:40px 0 ;text-align: center;font-size:14px;color:#888">暂无数据</div>
        </el-tab-pane>
        <el-tab-pane label="沟通" name="seven">
          <div class="info-title">沟通记录 <el-button type="text" style="float:right;" @click="showPop2('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in communicateListUserList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop2('edit',item)"></el-button>
              <el-button type="primary" icon="el-icon-delete" size="mini" @click="delGT(item)"></el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable">
              <tr>
                <td class="bgtd"><div class="tddiv">沟通时间</div></td>
                <td class="contd">{{item.communicateTime}}</td>
                <td class="bgtd"><div class="tddiv">沟通人</div></td>
                <td class="contd">{{item.communicateUserName}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">沟通内容</div></td>
                <td class="contd" colspan="3">{{item.content}}</td>

              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">沟通结果</div></td>
                <td class="contd" colspan="3">{{item.result}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">下次沟通时间</div></td>
                <td class="contd" colspan="3">{{item.nextCommunicateTime}}</td>
              </tr>
            </table>
          </div>
          <div v-if="communicateListUserList.length == 0 " style="padding:40px 0 ;text-align: center;font-size:14px;color:#888">暂无数据</div>
        </el-tab-pane>
        <el-tab-pane label="培训" name="eight">
          <div class="info-title">培训记录 <el-button type="text" style="float:right;" @click="showPop4('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in userTrainList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop4('edit',item)"></el-button>
              <el-button type="primary" icon="el-icon-delete" size="mini" @click="delPX(item)"></el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable">
              <tr>
                <td class="bgtd"><div class="tddiv">培训名称</div></td>
                <td class="contd">{{item.trainName}}</td>
                <td class="bgtd"><div class="tddiv">培训讲师</div></td>
                <td class="contd">{{item.trainUserName}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">培训开始时间</div></td>
                <td class="contd">{{item.startTrainTime}}</td>
                <td class="bgtd"><div class="tddiv">培训结束时间</div></td>
                <td class="contd">{{item.endTrainTime}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">培训学时</div></td>
                <td class="contd">{{item.trainHouse}}小时</td>
                <td class="bgtd"><div class="tddiv">培训成绩</div></td>
                <td class="contd">{{item.trainAchievement}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">培训证书</div></td>
                <td class="contd">{{item.certificateName}}</td>
                <td class="bgtd"><div class="tddiv">证书编号</div></td>
                <td class="contd">{{item.number}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">培训备注</div></td>
                <td class="contd" colspan="3">{{item.remark}}</td>
              </tr>
            </table>
          </div>
          <div v-if="userTrainList.length == 0 " style="padding:40px 0 ;text-align: center;font-size:14px;color:#888">暂无数据</div>
        </el-tab-pane>
        <el-tab-pane label="合同信息" name="ten">
          <div class="info-title">合同信息 <el-button type="text" style="float:right;" @click="showPop10('add','')">新增</el-button></div>
          <div style="position: relative;padding:20px;" v-for="item in htList">
            <el-button-group style="position: absolute;right:20px;top:0px;">
              <el-button type="primary" icon="el-icon-edit" size="mini" @click="showPop10('edit',item)"></el-button>
              <el-button type="primary" icon="el-icon-delete" size="mini" @click="delItem(item)"></el-button>
            </el-button-group>
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable">
              <tr>
                <td class="bgtd"><div class="tddiv">合同编号</div></td>
                <td class="contd">{{item.number}}</td>
                <td class="bgtd"><div class="tddiv">合同类型</div></td>
                <td class="contd">{{item.type | fiftype}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">合同开始时间</div></td>
                <td class="contd">{{item.startTime}}</td>
                <td class="bgtd"><div class="tddiv">合同结束时间</div></td>
                <td class="contd">{{item.endTime}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">合同期限</div></td>
                <td class="contd">{{item.term}}个月</td>
                <td class="bgtd"><div class="tddiv">合同状态</div></td>
                <td class="contd">{{item.status }}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">签约公司</div></td>
                <td class="contd">{{item.contractCompany}}</td>
                <td class="bgtd"><div class="tddiv">合同签订日期</div></td>
                <td class="contd">{{item.createTime}}</td>
              </tr>
              <tr>
                <td class="bgtd"><div class="tddiv">合同附件</div></td>
                <td class="contd" colspan="3">
                  <img :src="item" v-for="item in item.url" @click="fullImg(item)" style="width:30px;height:30px;object-fit: contain;cursor: pointer"/>
                </td>
              </tr>
            </table>
          </div>
          <div v-if="htList.length == 0 " style="padding:40px 0 ;text-align: center;font-size:14px;color:#888">暂无数据</div>
        </el-tab-pane>
        <el-tab-pane label="异动记录" name="eleven">
            <table cellspacing="0" cellpadding="0" style="width:100%" class="tongJitable" v-for="item in changeLogList">
            <tr>
              <td class="bgtd"><div class="tddiv">异动类型</div></td>
              <td class="contd">{{item.type | fifchangeType}}</td>
              <td class="bgtd"><div class="tddiv">日期</div></td>
              <td class="contd">{{item.createTime}}</td>
            </tr>
            <tr>
              <td class="bgtd"><div class="tddiv">异动备注</div></td>
              <td class="contd" colspan="3">{{item.remark}}</td>
            </tr>
          </table>
            <div v-if="changeLogList.length == 0 " style="padding:40px 0 ;text-align: center;font-size:14px;color:#888">暂无数据</div>
        </el-tab-pane>
        <el-tab-pane label="附件" name="twelve">
          <div class="info-title">基本资料</div>
          <div style="overflow: hidden;padding-bottom:10px">
            <div class="img-item">
                <div class="item-text">身份证正面</div>
                <div class="upimg-div"  v-if="idFront.url">
                  <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(idFront.fileId)"></i>
                  <img  :src="idFront.url" class="avatarImage" @click="fullImg(idFront.url)">
                </div>
                <el-upload
                  v-else
                  :show-file-list="false"
                  :data="uploadToken"
                  action="https://upload.qiniup.com"
                  :on-success="(res,file)=>{handleAvatarSuccess2(1,'idFront',res,file)}"
                  class="jiben-uploader">
                  <i class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>
              </div>
            <div class="img-item">
              <div class="item-text">身份证反面</div>
              <div class="upimg-div"  v-if="idBack.url">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(idBack.fileId)"></i>
                <img  :src="idBack.url" class="avatarImage" @click="fullImg(idBack.url)">
              </div>
              <el-upload
                v-else
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(2,'idBack',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
            <div class="img-item">
              <div class="item-text">学历证明</div>
              <div class="upimg-div"  v-if="education.url">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(education.fileId)"></i>
                <img  :src="education.url" class="avatarImage" @click="fullImg(education.url)">
              </div>
              <el-upload
                v-else
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(3,'education',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
            <div class="img-item">
              <div class="item-text">保密资料</div>
              <div class="upimg-div"  v-if="secrecy.url">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(secrecy.fileId)"></i>
                <img  :src="secrecy.url" class="avatarImage" @click="fullImg(secrecy.url)">
              </div>
              <el-upload
                v-else
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(4,'secrecy',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
            <div class="img-item">
              <div class="item-text">竞业协议</div>
              <div class="upimg-div"  v-if="nonCompete.url">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(nonCompete.fileId)"></i>
                <img  :src="nonCompete.url" class="avatarImage" @click="fullImg(nonCompete.url)">
              </div>
              <el-upload
                v-else
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(5,'nonCompete',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
          </div>

          <div class="info-title">入职资料<span style="font-weight: 400">（入职图片最多5张,其它均为单张）</span></div>
          <div style="overflow: hidden;padding-bottom:10px">
            <div class="img-item">
              <div class="item-text">入职体检单</div>
              <div class="upimg-div"  v-if="physical.url">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(physical.fileId)"></i>
                <img  :src="physical.url" class="avatarImage" @click="fullImg(physical.url)">
              </div>
              <el-upload
                v-else
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(6,'physical',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
            <div class="img-item">
              <div class="item-text">入职简历</div>
              <div class="upimg-div"  v-if="resume.url">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(resume.fileId)"></i>
                <img  :src="resume.url" class="avatarImage" @click="fullImg(resume.url)">
              </div>
              <el-upload
                v-else
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(7,'resume',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>

            <div class="img-item"  v-for="item in join">
              <div class="item-text">入职图片</div>
              <div class="upimg-div">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(item.fileId)"></i>
                <img  :src="item.url" class="avatarImage" @click="fullImg(item.url)">
              </div>
            </div>

            <div class="img-item" v-if="join.length < 5">
              <div class="item-text">入职图片</div>
              <el-upload
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(8,'join',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>

          </div>

          <div class="info-title">离职资料<span style="font-weight: 400">（离职图片最多5张，其它均为单张）</span></div>
          <div style="overflow: hidden;padding-bottom:10px">
            <div class="img-item">
              <div class="item-text">离职证明</div>
              <div class="upimg-div"  v-if="quitProve.url">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(quitProve.fileId)"></i>
                <img  :src="quitProve.url" class="avatarImage" @click="fullImg(quitProve.url)">
              </div>
              <el-upload
                v-else
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(9,'quitProve',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
            <div class="img-item">
              <div class="item-text">交接表</div>
              <div class="upimg-div"  v-if="handover.url">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(handover.fileId)"></i>
                <img  :src="handover.url" class="avatarImage" @click="fullImg(handover.url)">
              </div>
              <el-upload
                v-else
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(10,'handover',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>

            <div class="img-item" v-for="item in quit">
                <div class="item-text">离职图片</div>
                <div class="upimg-div">
                  <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(item.fileId)"></i>
                  <img  :src="item.url" class="avatarImage" @click="fullImg(item.url)">
                </div>
              </div>

            <div class="img-item" v-if="quit.length < 5">
              <div class="item-text">离职图片</div>
              <el-upload
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(11,'quit',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>

          </div>
          <div class="info-title">其它资料</div>
          <div style="overflow: hidden;padding-bottom:10px">
            <div class="img-item">
              <div class="item-text">生日图片</div>
              <div class="upimg-div"  v-if="brith.url">
                <i class="el-icon-error" style="cursor: pointer;position: absolute;right:0;top:0;" @click="handleRemove(brith.fileId)"></i>
                <img  :src="brith.url" class="avatarImage" @click="fullImg(brith.url)">
              </div>
              <el-upload
                v-else
                :show-file-list="false"
                :data="uploadToken"
                action="https://upload.qiniup.com"
                :on-success="(res,file)=>{handleAvatarSuccess2(12,'brith',res,file)}"
                class="jiben-uploader">
                <i class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </div>
          </div>

        </el-tab-pane>
        <el-tab-pane label="操作记录" name="thirteen">
          <el-table :data="logList">
            <el-table-column label="操作时间" prop="createTime" align="center"></el-table-column>
            <el-table-column label="操作人" prop="userName" align="center"></el-table-column>
            <el-table-column label="操作详情" prop="content" align="center"></el-table-column>
            <el-table-column label="操作备注" prop="remark" align="center"></el-table-column>
          </el-table>
        </el-tab-pane>
      </el-tabs>
    </el-card>

    <!--新增编辑任职-->
    <el-dialog
      :close-on-click-modal="false"
      title="任职记录"
      :visible.sync="dialogVisible"
      width="420px">
      <el-form :model="reziForm" size="mini" label-width="100px" ref="reziForm" :rules="rules">
        <el-form-item label="合同公司：" prop="contractCompany">
           <el-input v-model="reziForm.contractCompany"></el-input>
        </el-form-item>
        <el-form-item label="部门："  prop="department">
          <el-input v-model="reziForm.department"></el-input>
        </el-form-item>
        <el-form-item label="职位：" prop="job">
          <el-input v-model="reziForm.job"></el-input>
        </el-form-item>
        <el-form-item label="任职时间：" prop="time">
          <el-date-picker
            style="width:100%"
            v-model="reziForm.time"
            type="daterange"
            format="yyyy 年 MM 月 dd 日"
            value-format="yyyy-MM-dd"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注：">
          <el-input v-model="reziForm.remark" type="textarea" :rows="2"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose">取 消</el-button>
          <el-button type="primary" @click="handleConfirm" :loading="btnLoading">确 定</el-button>
      </span>
    </el-dialog>

    <gtpop ref="gtpop" @getCommunicateListUser="getCommunicateListUser"></gtpop>

    <pxpop ref="pxpop" @getshowUserTrainList="getshowUserTrainList"></pxpop>

    <jcpop ref="jcpop" @getShowRewardUser="getShowRewardUser"></jcpop>

    <htpop ref="htpop" @getcontractList="getcontractList"></htpop>

    <!--新增编辑工作-->
    <el-dialog
      :close-on-click-modal="false"
      title="工作记录"
      :visible.sync="dialogVisible5"
      width="440px">
      <el-form :model="gzForm" size="mini" label-width="90px" ref="gzForm" :rules="rules5">
        <el-form-item label="工作单位：" prop="workingName">
          <el-input v-model="gzForm.workingName"></el-input>
        </el-form-item>
        <el-form-item label="职务：" >
          <el-input v-model="gzForm.job"></el-input>
        </el-form-item>
        <el-form-item label="工作时间：" prop="time">
          <el-date-picker
            style="width:100%"
            v-model="gzForm.time"
            type="daterange"
            format="yyyy 年 MM 月 dd 日"
            value-format="yyyy-MM-dd"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="证明人：" >
          <el-input v-model="gzForm.witness"></el-input>
        </el-form-item>
        <el-form-item label="证明电话：">
          <el-input v-model="gzForm.witnessPhone"></el-input>
        </el-form-item>
        <el-form-item label="离职原因：" >
          <el-input v-model="gzForm.reasonsLeaving" type="textarea" :rows="2"></el-input>
        </el-form-item>
        <el-form-item label="工作备注：">
          <el-input v-model="gzForm.remark"  type="textarea" :rows="2"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose5">取 消</el-button>
          <el-button type="primary" @click="handleConfirm5" :loading="btnLoading5">确 定</el-button>
      </span>
    </el-dialog>

    <!--新增编辑证书-->
    <el-dialog
      :close-on-click-modal="false"
      title="证书记录"
      :visible.sync="dialogVisible6"
      width="440px">
      <el-form :model="zsForm" size="mini" label-width="90px" ref="zsForm" :rules="rules6">
        <el-form-item label="证书名称：" prop="majorName">
          <el-input v-model="zsForm.majorName"></el-input>
        </el-form-item>
        <el-form-item label="发证日期：" >
          <el-date-picker
            style="width:100%"
            v-model="zsForm.startTime"
            type="date"
            format="yyyy 年 MM 月 dd 日"
            value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="有效期：">
          <el-date-picker
            style="width:100%"
            v-model="zsForm.endTime"
            type="date"
            format="yyyy 年 MM 月 dd 日"
            value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="证书编号：" >
          <el-input v-model="zsForm.number"></el-input>
        </el-form-item>

        <el-form-item label="证书备注：">
          <el-input v-model="zsForm.remark"  type="textarea" :rows="2"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose6">取 消</el-button>
          <el-button type="primary" @click="handleConfirm6" :loading="btnLoading6">确 定</el-button>
      </span>
    </el-dialog>


    <!--新增编辑教育-->
    <el-dialog
      :close-on-click-modal="false"
      title="教育记录"
      :visible.sync="dialogVisible7"
      width="440px">
      <el-form :model="jyForm" size="mini" label-width="90px" ref="jyForm" :rules="rules7">
        <el-form-item label="学校名称：" prop="schoolName">
          <el-input v-model="jyForm.schoolName"></el-input>
        </el-form-item>
        <el-form-item label="学历："  prop="schoolType">
           <el-select v-model="jyForm.schoolType">
              <el-option value="1" label="小学"></el-option>
             <el-option value="2" label="初中"></el-option>
             <el-option value="3" label="高中"></el-option>
             <el-option value="4" label="中专"></el-option>
             <el-option value="5" label="大专"></el-option>
             <el-option value="6" label="本科"></el-option>
             <el-option value="7" label="硕士"></el-option>
             <el-option value="8" label="博士"></el-option>
           </el-select>
        </el-form-item>
        <el-form-item label="学习时间：" prop="time">
          <el-date-picker
            style="width:100%"
            v-model="jyForm.time"
            type="daterange"
            format="yyyy 年 MM 月 dd 日"
            value-format="yyyy-MM-dd"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="专业："  prop="major">
          <el-input v-model="jyForm.major"></el-input>
        </el-form-item>
        <el-form-item label="备注：">
          <el-input v-model="jyForm.remark" type="textarea" :rows="2"></el-input>
        </el-form-item>
        <el-form-item label="附件：">
          <el-upload
            class="jy-uploader"
            :data="uploadToken"
            action="https://upload.qiniup.com"
            :show-file-list="false"
            :on-success="handleAvatarSuccess">
            <i class="el-icon-plus avatar-uploader-icon" v-if="jyForm.url == ''"></i>
            <img :src="jyForm.url" v-else style="width:80px;height:80px;object-fit: contain;"/>
          </el-upload>
        </el-form-item>

      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose7">取 消</el-button>
          <el-button type="primary" @click="handleConfirm7" :loading="btnLoading7">确 定</el-button>
      </span>
    </el-dialog>

    <!--放大图片-->
    <el-dialog
      :visible.sync="dialogVisibleimg"
      width="800px">
      <img :src="fullSrc" style="width:100%;"/>
    </el-dialog>

    <!--新增编辑联系人-->
    <el-dialog
      :close-on-click-modal="false"
      title="紧急联系人"
      :visible.sync="dialogVisible8"
      width="440px">
      <el-form :model="lxrForm" size="mini" label-width="120px" ref="lxrForm" :rules="rules8">
        <el-form-item label="联系人姓名：" prop="name">
          <el-input v-model="lxrForm.name"></el-input>
        </el-form-item>
        <el-form-item label="关系：" >
          <el-input v-model="lxrForm.relation"></el-input>
        </el-form-item>
        <el-form-item label="手机号：" prop="phone">
          <el-input v-model="lxrForm.phone"></el-input>
        </el-form-item>
        <el-form-item label="联系人地址：" >
          <el-input v-model="lxrForm.address"></el-input>
        </el-form-item>
        <el-form-item label="是否为主联系人：">
           <el-radio-group v-model="lxrForm.isMain">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="2">否</el-radio>
           </el-radio-group>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose8">取 消</el-button>
          <el-button type="primary" @click="handleConfirm8" :loading="btnLoading8">确 定</el-button>
      </span>
    </el-dialog>

    <!--新增编辑家庭成员-->
    <el-dialog
      :close-on-click-modal="false"
      title="家庭成员"
      :visible.sync="dialogVisible9"
      width="440px">
      <el-form :model="cyForm" size="mini" label-width="120px" ref="cyForm" :rules="rules9">
        <el-form-item label="成员姓名：" prop="name">
          <el-input v-model="cyForm.name"></el-input>
        </el-form-item>
        <el-form-item label="关系：" >
          <el-input v-model="cyForm.relation"></el-input>
        </el-form-item>
        <el-form-item label="工作单位：">
          <el-input v-model="cyForm.company"></el-input>
        </el-form-item>
        <el-form-item label="任职岗位：" >
          <el-input v-model="cyForm.job"></el-input>
        </el-form-item>
        <el-form-item label="联系方式：" prop="phone">
          <el-input v-model="cyForm.phone"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose9">取 消</el-button>
          <el-button type="primary" @click="handleConfirm9" :loading="btnLoading9">确 定</el-button>
      </span>
    </el-dialog>

    <!--员工在职信息编辑-->
    <el-dialog
      :close-on-click-modal="false"
      title="在职信息"
      :visible.sync="dialogVisible11"
      width="900px">
      <el-form :model="zzForm" size="mini" label-width="120px" ref="zzForm" >
        <el-row>
          <el-col :span="12">
            <el-form-item label="员工姓名：">
              {{form.userName}}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工号：">
                <el-input v-model="zzForm.jobNumber"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="合同公司：">
              <el-input v-model="zzForm.contractCompany"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="部门：">
                {{ form.departmentName}}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="岗位：">
               <el-input v-model="zzForm.job"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工性质：">
              <el-select v-model="zzForm.attribute">
                <el-option label="全职" :value="1"></el-option>
                <el-option label="兼职" :value="2"></el-option>
                <el-option label="实习" :value="3"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工状态：">
              <el-select v-model="zzForm.status">
                <el-option label="试用" :value="0"></el-option>
                <el-option label="正式" :value="1"></el-option>
                <el-option label="离职" :value="2"></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="入职时间：">
              <el-date-picker
                v-model="zzForm.joinTime"
                style="width:200px"
                type="date"
                format="yyyy 年 MM 月 dd 日"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="试用期：">
                <el-input v-model="zzForm.probation" style="width:200px"></el-input> 个月
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="转正时间：">
              <el-date-picker
                v-model="zzForm.workTime"
                style="width:200px"
                type="date"
                format="yyyy 年 MM 月 dd 日"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="优点：">
                <el-input v-model="zzForm.advantage" type="textarea" :rows="2"></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="需提升点：">
              <el-input v-model="zzForm.improved" type="textarea" :rows="2"></el-input>
            </el-form-item>
          </el-col>


          <el-col :span="12">
            <el-form-item label="雄心壮志：">
              <el-input v-model="zzForm.ambition" type="textarea" :rows="2"></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="工作信条：">
              <el-input v-model="zzForm.creed" type="textarea" :rows="2"></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="英雄宣言：">
              <el-input v-model="zzForm.declaration" type="textarea" :rows="2"></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="喜欢被提醒需转变的方式：">
              <el-input v-model="zzForm.remind" type="textarea" :rows="2"></el-input>
            </el-form-item>
          </el-col>


        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose11">取 消</el-button>
          <el-button type="primary" @click="handleConfirm11" :loading="btnLoading11">确 定</el-button>
      </span>
    </el-dialog>


    <!--员工基本信息编辑-->
    <el-dialog
      :close-on-click-modal="false"
      title="基本信息"
      :visible.sync="dialogVisible12"
      width="900px">
      <el-form :model="jbForm" size="mini" label-width="120px" ref="jbForm" >
        <el-row>
          <el-col :span="12">
            <el-form-item label="员工姓名：">
              {{form.userName}}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="性别：">
              <el-radio-group v-model="jbForm.gender">
                <el-radio :label="1">男</el-radio>
                <el-radio :label="2">女</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="证件类型：">
              身份证
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="证件号：">
              <el-input style="width:200px" v-model="jbForm.certificates"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工性质：">
              <el-select v-model="jbForm.attribute">
                <el-option label="全职" :value="1"></el-option>
                <el-option label="兼职" :value="2"></el-option>
                <el-option label="实习" :value="3"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="员工状态：">
              <el-select v-model="jbForm.status">
                <el-option label="试用" :value="0"></el-option>
                <el-option label="正式" :value="1"></el-option>
                <el-option label="离职" :value="2"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出生日期：">
              <el-date-picker
                v-model="jbForm.brithTime"
                style="width:200px"
                type="date"
                format="yyyy 年 MM 月 dd 日"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="是否阴历生日：">
              <el-radio-group v-model="jbForm.isLunarCalendar">
                <el-radio :label="2">否</el-radio>
                <el-radio :label="1">是</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="民族：">
              <el-input style="width:200px" v-model="jbForm.nation"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="籍贯：">
              <el-input style="width:200px" v-model="jbForm.nativePlace"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="政汉面貌：">
              <el-input style="width:200px" v-model="jbForm.politicalStatus"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="参加工作时间：">
              <el-date-picker
                v-model="jbForm.firstWorkTime"
                style="width:200px"
                type="date"
                format="yyyy 年 MM 月 dd 日"
                value-format="yyyy-MM-dd">
              </el-date-picker>
            </el-form-item>
          </el-col>


        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose12">取 消</el-button>
          <el-button type="primary" @click="handleConfirm12" :loading="btnLoading12">确 定</el-button>
      </span>
    </el-dialog>

    <!--员工联系信息编辑-->
    <el-dialog
      :close-on-click-modal="false"
      title="联系信息"
      :visible.sync="dialogVisible13"
      width="900px">
      <el-form :model="lxForm" size="mini" label-width="120px" ref="lxForm" >
        <el-row>
          <el-col :span="12">
            <el-form-item label="员工姓名：">
              {{form.userName}}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="手机号：">
              <el-input style="width:200px" v-model="lxForm.mobile"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="QQ号：">
              <el-input style="width:200px" v-model="lxForm.qq"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="微信号：">
              <el-input style="width:200px" v-model="lxForm.wechat"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="个人邮箱：">
              <el-input style="width:200px" v-model="lxForm.email"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工作手机：">
              <el-input style="width:200px" v-model="lxForm.workingMobile"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工作邮箱：">
              <el-input style="width:200px" v-model="lxForm.workingEmail"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="现居住地：">
              <el-input v-model="lxForm.address"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose13">取 消</el-button>
          <el-button type="primary" @click="handleConfirm13" :loading="btnLoading13">确 定</el-button>
      </span>
    </el-dialog>

  </div>
</template>

<script>
    import {getOrderUsersList,getQiniuToken} from '@/api/partner'
    import {getDeptList} from '@/api/management'
    import {formatDate} from '@/utils/date';
    import store from '@/store'
    import {detailUser,showOfficeUser,addOfficeUser,upDateOfficeUser,deleteOffice,communicateListUser,
      addCommunicate,updateCommunicate,deleteCommunicate,showRewardUser,addReward,deleteReward,
      showUserTrainList,addTrain,updateTrain,deleteTrain,schoolListUser,workingListUser,addWorking,
      updateWorking,deleteWorking,majorListUser,deleteMajor,updateMajor,addMajor,addSchool,updateSchool,deleteSchool,
      contactListUser,addContact,updateContact,deleteContact,addHome,updateHome,homeListUser,deleteHome,achievementListUser,
      contractList,deleteContract,changeLogListUser,updateInfo,logListUser,fileListUser,addFileUser,deleteFileUser,overviewUser,growUpUser,updateLogoUser} from '@/api/company'
    import { mapGetters } from 'vuex'
    import gtpop from './components/gtpop.vue'
    import pxpop from './components/pxpop.vue'
    import jcpop from './components/jcpop.vue'
    import htpop from './components/htpop.vue'
    const defaultReziForm = {
      "userId": '',
      "contractCompany": "",	                	//合同公司
      "department": "",							//部门
      "job": "",									//职位
      "remark": "",								//备注
      "startTime": "",		//开始时间
      "endTime": ""		,	//结束时间
      time:[],
    }



    const defaultGZForm = {
      "userId": '',						//用户id
      "workingId": '',						//自增id
      "workingName": "",					//工作单位
      "job": "",							//职务
      "witness": "",				//证明人
      "witnessPhone": "",			//证明人手机号
      "reasonsLeaving": "",			//离职原因
      "remark": "",					//备注
      "startTime": "",			//开始时间
      "endTime": ""	,			//结束时间
      time:[]
    }

    const defaultZSForm = {
      "userId": '',					//用户id
      "majorName": "",				//证书名称
      "number": "",					//编号
      "remark": "",				//备注
      "startTime": "",		//开始时间
      "endTime": ""		,	//到期日期
    }



    const defaultJYForm = {
      "userId": '',				//用户id
      "schoolName": "",		//学校名称
      "schoolType": '',			//学历 1 小学 2 初中 3 高中 4 中专 5 大专 6 本科 7 硕士 8 博士
      "major": "",		//专业
      "remark": "",				//备注
      "startTime": "",	//开始时间
      "endTime": ""	,	//结束时间
      url:'',
      time:[]
    }

    const defaultLXRForm = {
      "userId": '',				//用户id
      "name": "",			//联系人名称
      "relation": "",			//关系
      "phone": "",		//证明者手机号
      "address": "",			//地址
      "isMain": 2					//是否是主要联系人 1 是 2 不是
    }

    const defaultCYForm = {
      "userId": '',				//用户id
      "name": "",			//成员姓名
      "relation": "",			//关系
      "phone": "",		//证明者手机号
      "company": "",			//所属单位
      "job": ""
    }

    const defaultZZForm = {
      "userId": '',    //用户id
      "jobNumber": "",   //工号
      "contractCompany": '' , //合同公司
      "job": '' ,    //岗位
      "attribute": "",  //工作性质 1全职，2兼职 3实习
      "status": ''  ,   //1试用，2转正 3离职
      "probation": '' ,   //试用期
      "advantage": '' ,   //优点
      "improved": '',   //需要改进的地方
      "joinTime": '' ,   //入职时间
      "workTime": ''  ,  //转正时间

      "ambition": '' ,   //雄心壮志
      "creed": '',    //工作信条
      "declaration": ''   , //英雄宣言
      "remind": ''  ,  //喜欢被提醒需转变的方式
    }

    const defaultJBForm = {
      "userId": '',    //用户id
      "gender": "",    //性别：1男，2女',
      "certificates": "",  //证件号码
      "attribute": "",  //工作性质 1全职，2兼职 3实习
      "status": ''  ,   //1试用，2转正 3离职
      "brithTime": '' ,   //出生日期
      "isLunarCalendar": 2 , //1 是 阴历 2 不是
      "nation": ''  ,  //民族
      "nativePlace": '',   //籍贯
      "politicalStatus":'', //政治地位
      "firstWorkTime": '' ,  //第一次工作时间
    }

    const defaultLXForm = {
      "userId": '',    //用户id
      "mobile": "",   //手机号
      "qq": '',     //qq
      "wechat": '',     //微信
      "email": '' ,    //邮箱
      "workingMobile": '' ,  //工作手机
      "workingEmail": '' ,  //工作邮箱
      "address": ''  ,  //居住地
    }

    export default {
        name: "index",
        components : {
          gtpop:gtpop,
          pxpop:pxpop,
          jcpop:jcpop,
          htpop:htpop
        },
        data(){
            return{
              activities: [{
                content: '活动按期开始',
                timestamp: '2018-04-15'
              }, {
                content: '通过审核',
                timestamp: '2018-04-13'
              }, {
                content: '创建成功',
                timestamp: '2018-04-11'
              }],
              activeName:'first',
              form:{},
              showOfficeList:[],

              dialogVisible:false,
              reziForm:JSON.parse(JSON.stringify(defaultReziForm)),
              rules:{
                contractCompany:[{required: true, message: '此项必填', trigger: 'blur'},],
                department:[{required: true, message: '此项必填', trigger: 'blur'},],
                job:[{required: true, message: '此项必填', trigger: 'blur'},],
                time:[{required: true, message: '此项必填', trigger: 'change'},],
              },
              btnLoading:false,
              popType:'',

              communicateListUserList:[],


             showRewardUserList:[],


              userTrainList:[],



              workingList:[],
              gzForm:JSON.parse(JSON.stringify(defaultGZForm)),
              rules5:{
                workingName:[{required: true, message: '此项必填', trigger: 'blur'},],
                time:[{required: true, message: '此项必填', trigger: 'change'},],
              },
              btnLoading5:false,
              popType5:'',
              dialogVisible5:false,

              majorListUserList:[],
              zsForm:JSON.parse(JSON.stringify(defaultZSForm)),
              rules6:{
                majorName:[{required: true, message: '此项必填', trigger: 'blur'},],
              },
              btnLoading6:false,
              popType6:'',
              dialogVisible6:false,


              dialogVisibleimg:false,
              fullSrc:'',

              schoolList:[],
              jyForm:JSON.parse(JSON.stringify(defaultJYForm)),
              rules7:{
                schoolName:[{required: true, message: '此项必填', trigger: 'blur'},],
                schoolType:[{required: true, message: '此项必填', trigger: 'change'},],
                major:[{required: true, message: '此项必填', trigger: 'blur'},],
                time:[{required: true, message: '此项必填', trigger: 'change'},],
              },
              btnLoading7:false,
              popType7:'',
              dialogVisible7:false,
              uploadToken:{
                token:'',
              },
              imgDomain:'',

              contactList:[],
              lxrForm:JSON.parse(JSON.stringify(defaultLXRForm)),
              rules8:{
                name:[{required: true, message: '此项必填', trigger: 'blur'},],
                phone:[{required: true, message: '此项必填', trigger: 'blur'},],
              },
              btnLoading8:false,
              popType8:'',
              dialogVisible8:false,

              homeList:[],
              cyForm:JSON.parse(JSON.stringify(defaultCYForm)),
              rules9:{
                name:[{required: true, message: '此项必填', trigger: 'blur'},],
                phone:[{required: true, message: '此项必填', trigger: 'blur'},],
              },
              btnLoading9:false,
              popType9:'',
              dialogVisible9:false,

              achievementList:[],

              htList:[],
              changeLogList:[],

              zzForm:JSON.parse(JSON.stringify(defaultZZForm)),
              dialogVisible11:false,
              btnLoading11:false,

              jbForm:JSON.parse(JSON.stringify(defaultJBForm)),
              dialogVisible12:false,
              btnLoading12:false,

              lxForm:JSON.parse(JSON.stringify(defaultLXForm)),
              dialogVisible13:false,
              btnLoading13:false,

              logList:[],

              idFront:{},
              idBack:{},
              quit:[],
              education:{},
              secrecy:{},
              nonCompete:{},
              physical:{},
              resume:{},
              join:[],
              quitProve:{},
              handover:{},
              brith:{},
              overviewInfo:{},
              growUpUserList:[],
            }
        },

        computed: {
          ...mapGetters([
            'name',
            'mobile',
            'userId'
          ]),

        },
        created() {
            this.getInfo();
            this.getUploadToken();
            this.getOverviewUser();
            this.getgrowUpUserList();
        },

        filters: {
          fifgender(val){
            if(val == 1){
              return '男'
            }else if( val == 2){
              return '女'
            }else {
              return ''
            }
          },
          fifattribute(val){
            if(val == 1){
              return '全职'
            }else if( val == 2){
              return '兼职'
            }else if( val == 3){
              return '实习'
            }
          },
          fifmajor(val){
            if(val == 1){
              return '小学'
            }else if( val == 2){
              return '初中'
            }else if( val == 3){
              return '高中'
            }else if( val == 4){
              return '中专'
            }else if( val == 5){
              return '大专'
            }else if( val == 6){
              return '本科'
            }else if( val == 7){
              return '硕士'
            }else if( val == 8){
              return '博士'
            }
          },

          fifBFB(val1,val2){
            if(val2 > 0){
              return ((val1/val2)*100).toFixed(2)
            }else{
              return 0
            }
          },
          fiftype(val){
            if(val == 1){
              return '固定合同'
            }else if(val == 2){
              return '实习协议'
            }else if(val == 3){
              return '其它'
            }
          },

          fifstatus(val){
            if(val == 1){
              return '执行中'
            }else if(val == 2){
              return '失效'
            }
          },

          fifchangeType(val){
            if(val == 1){  //1 转正 2 调岗 3 晋身 4 降级 5 离职
              return '转正'
            }else if(val == 2){
              return '调岗'
            }else if(val == 3){
              return '晋升'
            }else if(val == 4){
              return '降级'
            }else if(val == 5){
              return '离职'
            }
          },

          fifygstatus(val){
            if(val == 0){  //1试用，2转正 3离职
              return '试用'
            }else if(val == 1){
              return '正式'
            }else if(val == 2){
              return '离职'
            }
          },

          fifYears(val){
             let year = parseInt(val/12);
             let month = parseInt(val%12);
             let yText = year ? year + '年' : '';
             let mText = month ? month + '个月' : '';
             if(yText=='' && mText == ''){
               return '-'
             }else{
               return yText+mText
             }
          },
        },
        methods:{
          handleClick(tab){
            switch (tab.name){
              case 'first':
                this.getUploadToken();
                this.getOverviewUser();
                this.getgrowUpUserList();
                break;
              case 'second':
                this.getShowOfficeUser();
                break;
              case 'third':
                this.getschoolList();
                this.getworkingList();
                this.getmajorList();
                break;
              case 'fourth':
                this.getcontactList();
                this.gethomeListUserList();
                break;
              case 'five':
                this.getachievementList();
                break;
              case 'six':
                this.getShowRewardUser();
                break;
              case 'seven':
                this.getCommunicateListUser();
                break;
              case 'eight':
                this.getshowUserTrainList();
                break;
              case 'ten':
                this.getcontractList();
                break;
              case 'eleven':
                this.getchangeLogListUser();
                break;
              case 'twelve':
                this.getUploadToken();
                this.getImgList();
                break;
              case 'thirteen':
                this.getlogListUser();
                break;
            }

          },
          //用户成长
          getgrowUpUserList(){
            growUpUser({userId:this.$route.query.userId}).then((res)=>{
               this.growUpUserList = res;
            })
          },
          //用户概览
          getOverviewUser(){
            overviewUser({userId:this.$route.query.userId}).then((res)=>{
                this.overviewInfo = res;
            })
          },
          handleAvatarSuccess3(res){
            let url = this.imgDomain+res.key;
            updateLogoUser({userId:this.$route.query.userId,logo:url}).then((res)=>{
             this.getOverviewUser()
              this.$message({
                type: 'success',
                message: '头像修改!'
              });
            })
          },
          //获取附件列表
          getImgList(){
            fileListUser({userId:this.$route.query.userId}).then((res)=>{
              this.idFront = res.list.idFront;
              this.idBack = res.list.idBack;
              this.quit = res.list.quit;
              this.education = res.list.education;
              this.secrecy = res.list.secrecy;
              this.nonCompete = res.list.nonCompete;
              this.physical = res.list.physical;
              this.resume = res.list.resume;
              this.join = res.list.join;
              this.quitProve = res.list.quitProve;
              this.handover = res.list.handover;
              this.brith = res.list.brith;
            })
          },

          //图片删除
          handleRemove(fileId){
            deleteFileUser({fileId:fileId}).then(()=>{
              this.getImgList();
            })
          },
          //图片上传成功
          handleAvatarSuccess2(type,key,res){
            let url = this.imgDomain+res.key;
            addFileUser({userId:this.$route.query.userId,type:type,url:url}).then((res)=>{
              this.getImgList();
              this.$message({
                type: 'success',
                message: '上传成功!'
              });
            })
          },
          //编辑在职信息
          showPop11(){
            this.dialogVisible11 = true;
            this.zzForm = JSON.parse(JSON.stringify(defaultZZForm));
            for (let key in defaultZZForm) {
              this.zzForm[key] = this.form[key]
            }
          },

          //关闭弹窗
          handleClose11(){
            this.dialogVisible11 = false;
            this.btnLoading11 = false;
          },

          //确认员工在职信息
          handleConfirm11(){
            this.$refs.zzForm.validate((valid) => {
              if (valid) {
                this.btnLoading11 = true;
                let data = JSON.parse(JSON.stringify(this.zzForm))
                updateInfo(data).then((res)=>{
                  this.$message({
                    type: 'success',
                    message: '操作成功!'
                  });
                  this.btnLoading11 = false;
                  this.handleClose11();
                  this.getInfo();
                }).catch(()=>{
                  this.btnLoading11 = false;
                })
              }
            })

          },


          //编辑在职信息
          showPop12(){
            this.dialogVisible12 = true;
            this.jbForm = JSON.parse(JSON.stringify(defaultJBForm));
            for (let key in defaultJBForm) {
              this.jbForm[key] = this.form[key]
            }
          },

          //关闭弹窗
          handleClose12(){
            this.dialogVisible12 = false;
            this.btnLoading12 = false;
          },

          //确认员工在职信息
          handleConfirm12(){
            this.$refs.jbForm.validate((valid) => {
              if (valid) {
                this.btnLoading12 = true;
                let data = JSON.parse(JSON.stringify(this.jbForm))
                updateInfo(data).then((res)=>{
                  this.$message({
                    type: 'success',
                    message: '操作成功!'
                  });
                  this.btnLoading12 = false;
                  this.handleClose12();
                  this.getInfo();
                }).catch(()=>{
                  this.btnLoading12 = false;
                })
              }
            })
          },


          //编辑联系信息
          showPop13(){
            this.dialogVisible13 = true;
            this.lxForm = JSON.parse(JSON.stringify(defaultLXForm));
            for (let key in defaultLXForm) {
              this.lxForm[key] = this.form[key]
            }
          },

          //关闭弹窗
          handleClose13(){
            this.dialogVisible13 = false;
            this.btnLoading13 = false;
          },

          //确认员工在职信息
          handleConfirm13(){
            this.$refs.lxForm.validate((valid) => {
              if (valid) {
                this.btnLoading13 = true;
                let data = JSON.parse(JSON.stringify(this.lxForm))
                updateInfo(data).then((res)=>{
                  this.$message({
                    type: 'success',
                    message: '操作成功!'
                  });
                  this.btnLoading13 = false;
                  this.handleClose13();
                  this.getInfo();
                }).catch(()=>{
                  this.btnLoading13 = false;
                })
              }
            })
          },




          fullImg(src){
            this.dialogVisibleimg = true;
            this.fullSrc = src;
          },



          //显示新增/编辑任职记录
          showPop1(type,item){
            this.popType = type
            if(type == 'add'){
              this.reziForm = JSON.parse(JSON.stringify(defaultReziForm))
            }else{
              this.reziForm = JSON.parse(JSON.stringify(item))
              if(item.startTime){
                this.reziForm.time = [item.startTime,item.startTime]
              }
            }
            this.reziForm.userId = this.$route.query.userId
            this.dialogVisible = true;
          },
          handleClose(){
            this.dialogVisible = false;
          },
          handleConfirm(){
            this.$refs.reziForm.validate((valid) => {
              if (valid) {
                this.btnLoading = true;
                let data = JSON.parse(JSON.stringify(this.reziForm));
                data.startTime = data.time[0]
                data.endTime = data.time[1]
                delete data.time;
                let fn;
                if(this.popType == 'add'){
                  fn = addOfficeUser
                }else{
                  fn = upDateOfficeUser
                }
                fn(data).then(()=>{
                  this.btnLoading = false;
                  this.handleClose();
                  this.getShowOfficeUser();
                }).catch(()=>{
                  this.btnLoading = false;
                })
              }
            })
          },

          //删除任职
          delRZ(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteOffice({officeId:item.officeId}).then(()=>{
                this.getShowOfficeUser();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },

          //获取员工详情
          getInfo(){
            detailUser({userId:this.$route.query.userId}).then((res)=>{
                  this.form = res.detail;
                  console.log("form",this.form)
            })
          },

          //获取任职列表
          getShowOfficeUser(){
            showOfficeUser({userId:this.$route.query.userId}).then((res)=>{
              this.showOfficeList = res.list;
            })
          },


          //获取沟通列表
          getCommunicateListUser(){
            communicateListUser({userId:this.$route.query.userId}).then((res)=>{
              this.communicateListUserList = res.list;
            })
          },
          //显示新增/编辑沟通记录
          showPop2(type,item){
            let form = {};
            if(type == 'add'){
              form = {}
            }else{
              form = JSON.parse(JSON.stringify(item))
            }
            form.userId = this.$route.query.userId;
            console.log("form",form)
            this.$refs.gtpop.showPop2(type,form,'info')
          },

          //删除沟通
          delGT(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteCommunicate({communicateId:item.communicateId}).then(()=>{
                this.getCommunicateListUser();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },

          //获取奖惩列表
          getShowRewardUser(){
            showRewardUser({userId:this.$route.query.userId}).then((res)=>{
              this.showRewardUserList = res.list;
            })
          },

          //显示新增/编辑奖惩记录
          showPop3(type,item){
            let form = {};
            if(type == 'add'){
              form = {}
            }else{
              form = JSON.parse(JSON.stringify(item))
            }
            form.userId = this.$route.query.userId;
            console.log("form",form)
            this.$refs.jcpop.showPop3(type,form,'info')
          },

          //撤消奖惩
          CXJC(item){
            this.$refs.jcpop.showPop4(item)
          },

          //删除奖惩
          delJC(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteReward({rewardId:item.rewardId}).then(()=>{
                this.getShowRewardUser();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },

          //获取培训列表
          getshowUserTrainList(){
            showUserTrainList({userId:this.$route.query.userId}).then((res)=>{
              this.userTrainList = res.list;
            })
          },

          //显示新增/编辑任职记录
          showPop4(type,item){
            let form = {};
            if(type == 'add'){
              form = {}
            }else{
              form = JSON.parse(JSON.stringify(item))
            }
            form.userId = this.$route.query.userId;
            this.$refs.pxpop.showPop4(type,form,'info')
          },


          //删除培训
          delPX(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteTrain({trainId:item.trainId}).then(()=>{
                this.getshowUserTrainList();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },

          //员工工作列表
          getworkingList(){
            workingListUser({userId:this.$route.query.userId}).then((res)=>{
              this.workingList = res.list;
            })
          },
          //显示新增/编辑任职记录
          showPop5(type,item){
            this.popType5 = type
            if(type == 'add'){
              this.gzForm = JSON.parse(JSON.stringify(defaultGZForm))
            }else{
              this.gzForm = JSON.parse(JSON.stringify(item))
              if(item.startTime){
                this.gzForm.time = [item.startTime,item.startTime]
              }
            }
            this.gzForm.userId = this.$route.query.userId
            this.dialogVisible5 = true;
          },
          handleClose5(){
            this.dialogVisible5 = false;
          },
          handleConfirm5(){
            this.$refs.gzForm.validate((valid) => {
              if (valid) {
                this.btnLoading5 = true;
                let data = JSON.parse(JSON.stringify(this.gzForm));
                data.startTime = data.time[0]
                data.endTime = data.time[1]
                delete data.time;
                let fn;
                if(this.popType5 == 'add'){
                  fn = addWorking
                }else{
                  fn = updateWorking
                }
                fn(data).then(()=>{
                  this.btnLoading5 = false;
                  this.handleClose5();
                  this.getworkingList();
                }).catch(()=>{
                  this.btnLoading5 = false;
                })
              }
            })
          },

          //删除工作
          delGZ(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteWorking({workingId:item.workingId}).then(()=>{
                this.getworkingList();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },

          //员工证书列表
          getmajorList(){
            majorListUser({userId:this.$route.query.userId}).then((res)=>{
              this.majorListUserList = res.list;
            })
          },

          //显示新增/编辑证书记录
          showPop6(type,item){
            this.popType6 = type
            if(type == 'add'){
              this.zsForm = JSON.parse(JSON.stringify(defaultZSForm))
            }else{
              this.zsForm = JSON.parse(JSON.stringify(item))
            }
            this.zsForm.userId = this.$route.query.userId
            this.dialogVisible6 = true;
          },
          handleClose6(){
            this.dialogVisible6 = false;
          },
          handleConfirm6(){
            this.$refs.zsForm.validate((valid) => {
              if (valid) {
                this.btnLoading6 = true;
                let data = JSON.parse(JSON.stringify(this.zsForm));
                let fn;
                if(this.popType6 == 'add'){
                  fn = addMajor
                }else{
                  fn = updateMajor
                }
                fn(data).then(()=>{
                  this.btnLoading6 = false;
                  this.handleClose6();
                  this.getmajorList();
                }).catch(()=>{
                  this.btnLoading6 = false;
                })
              }
            })
          },

          //删除证书
          delZS(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteMajor({majorId:item.majorId}).then(()=>{
                this.getmajorList();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },

          //获取员工教育列表
          getschoolList(){
            schoolListUser({userId:this.$route.query.userId}).then((res)=>{
              this.schoolList = res.list;
            })
          },

          //显示新增/编辑教育记录
          showPop7(type,item){
            this.popType7 = type
            if(type == 'add'){
              this.jyForm = JSON.parse(JSON.stringify(defaultJYForm))
            }else{
              this.jyForm = JSON.parse(JSON.stringify(item))
              if(item.startTime){
                this.jyForm.time = [item.startTime,item.startTime]
              }
            }
            this.jyForm.userId = this.$route.query.userId
            this.dialogVisible7 = true;
            this.getUploadToken();
          },
          handleClose7(){
            this.dialogVisible7 = false;
          },
          handleConfirm7(){
            this.$refs.jyForm.validate((valid) => {
              if (valid) {
                this.btnLoading7 = true;
                let data = JSON.parse(JSON.stringify(this.jyForm));
                data.startTime = data.time[0]
                data.endTime = data.time[1]
                delete data.time;
                let fn;
                if(this.popType7 == 'add'){
                  fn = addSchool
                }else{
                  fn = updateSchool
                }
                fn(data).then(()=>{
                  this.btnLoading7 = false;
                  this.handleClose7();
                  this.getschoolList();
                }).catch(()=>{
                  this.btnLoading7 = false;
                })
              }
            })
          },

          //删除教育
          delJY(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteSchool({schoolId:item.schoolId}).then(()=>{
                this.getschoolList();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },

          //上传图片
          handleAvatarSuccess(res){
            this.jyForm.url = this.imgDomain+res.key
          },
          //获取七牛TOKEN
          getUploadToken(){
            getQiniuToken().then((res)=>{
              this.uploadToken.token = res.token;
              this.imgDomain = res.domain
            })
          },


          //获取员工联系人列表
          getcontactList(){
            contactListUser({userId:this.$route.query.userId}).then((res)=>{
              this.contactList = res.list;
            })
          },

          //显示新增/编辑联系人记录
          showPop8(type,item){
            this.popType8 = type
            if(type == 'add'){
              this.lxrForm = JSON.parse(JSON.stringify(defaultLXRForm))
            }else{
              this.lxrForm = JSON.parse(JSON.stringify(item))
            }
            this.lxrForm.userId = this.$route.query.userId
            this.dialogVisible8 = true;
          },
          handleClose8(){
            this.dialogVisible8 = false;
          },
          handleConfirm8(){
            this.$refs.lxrForm.validate((valid) => {
              if (valid) {
                this.btnLoading8 = true;
                let data = JSON.parse(JSON.stringify(this.lxrForm));
                let fn;
                if(this.popType8 == 'add'){
                  fn = addContact
                }else{
                  fn = updateContact
                }
                fn(data).then(()=>{
                  this.btnLoading8 = false;
                  this.handleClose8();
                  this.getcontactList();
                }).catch(()=>{
                  this.btnLoading8 = false;
                })
              }
            })
          },

          //删除联系人
          delLXR(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteContact({contactId:item.contactId}).then(()=>{
                this.getcontactList();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },


          //获取员工家庭成员列表
          gethomeListUserList(){
            homeListUser({userId:this.$route.query.userId}).then((res)=>{
              this.homeList = res.list;
            })
          },

          //显示新增/编辑家庭成员记录
          showPop9(type,item){
            this.popType9 = type
            if(type == 'add'){
              this.cyForm = JSON.parse(JSON.stringify(defaultCYForm))
            }else{
              this.cyForm = JSON.parse(JSON.stringify(item))
            }
            this.cyForm.userId = this.$route.query.userId
            this.dialogVisible9 = true;
          },
          handleClose9(){
            this.dialogVisible9 = false;
          },
          handleConfirm9(){
            this.$refs.cyForm.validate((valid) => {
              if (valid) {
                this.btnLoading9 = true;
                let data = JSON.parse(JSON.stringify(this.cyForm));
                let fn;
                if(this.popType9 == 'add'){
                  fn = addHome
                }else{
                  fn = updateHome
                }
                fn(data).then(()=>{
                  this.btnLoading9 = false;
                  this.handleClose9();
                  this.gethomeListUserList();
                }).catch(()=>{
                  this.btnLoading9 = false;
                })
              }
            })
          },

          //删除家庭成员
          delCY(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteHome({homeId:item.homeId}).then(()=>{
                this.gethomeListUserList();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },

          //业绩
          getachievementList(){
            achievementListUser({userId:this.$route.query.userId}).then((res)=>{
              this.achievementList = res.list;
            })
          },

          //显示新增/编辑合记录
          showPop10(type,item){
            let form = {};
            if(type == 'add'){
              form = {}
            }else{
              form = JSON.parse(JSON.stringify(item))
            }
            form.userId = this.$route.query.userId;
            this.$refs.htpop.showPop(type,form,'info')
          },

          //合同列表
          getcontractList(){
            contractList({userId:this.$route.query.userId}).then((res)=>{
              this.htList = res.list;
            })
          },

          delItem(item){
            this.$confirm('确认删除此记录吗？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              deleteContract({contractId:item.contractId}).then(()=>{
                this.getcontractList();
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          },

          //异动列表
          getchangeLogListUser(){
            changeLogListUser({userId:this.$route.query.userId}).then((res)=>{
              this.changeLogList = res.list;
            })
          },

          //操作记录
          getlogListUser(){
            logListUser({userId:this.$route.query.userId}).then((res)=>{
              this.logList = res.list;
            })
          },

        },
    }
</script>

<style  lang="scss">
    .yuanggong-page .info-title{
        font-size:14px;
        font-weight: bold;
        line-height: 20px;
        margin-top:40px;
        margin-bottom:20px;
    }
    .yuanggong-page .tongJitable{
      border-left:1px solid #EBEEF5;
      border-top:1px solid #EBEEF5;
      font-size:12px;
      margin-bottom:20px;
      td{
        border-right:1px solid #EBEEF5;
        border-bottom:1px solid #EBEEF5;
        text-align: left;
        padding:15px;

      }
      .bgtd{
        background: #f5f7fa;
        width:120px;

      }
      .contd{

      }
    }
    .yuanggong-page .fenxi-row{
      overflow: hidden;
      .fenxi-col{
        display: inline-block;
        width:140px;
        text-align: center;
        padding:20px 0 30px 0;
        .name{
          font-size:12px;
        }
        .num{
          font-size:18px;
          font-weight: bold;
          margin-bottom:5px;
        }
      }
    }

    .jiben-uploader .el-upload {
      border: 1px dashed #d9d9d9;
      border-radius: 6px;
      width: 280px;
      height: 158px;
      display: block;
    }
    .jiben-uploader .el-upload:hover {
      border-color: #409EFF;
    }
    .jiben-uploader .avatar-uploader-icon {
      font-size: 28px;
      color: #8c939d;
      text-align: center;
      padding-top:59px;
    }
    .jiben-uploader .avatar {
      width: 280px;
      height: 158px;
      display: block;
    }
    .jy-uploader{
      margin-bottom:10px;
      width:80px;
      height:80px;
      border:1px solid #DCDFE6;
      text-align: center;
      line-height: 80px;
    }

    .img-item{
      width: 280px;
      height: 188px;
      float:left;
      margin-right:20px;
      margin-bottom:20px;
      .item-text{
        font-size: 14px;
        color:#888;
        margin-bottom:10px;
      }
    }

    .upimg-div{
      border: 1px dashed #d9d9d9;
      border-radius: 6px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
      width: 280px;
      height: 158px;
      img{
        width: 280px;height: 158px;object-fit: contain;cursor: pointer;
      }
    }
</style>
